---
title: SitemapLoader
---

This notebook goes over how to use the [`SitemapLoader`](https://api.js.langchain.com/classes/_langchain_community.document_loaders_web_sitemap.SitemapLoader.html) class to load sitemaps into `Document`s.

## Setup

First, we need to install the `langchain` package:

```bash npm
npm install @langchain/community @langchain/core
```

The URL passed in must either contain the `.xml` path to the sitemap, or a default `/sitemap.xml` will be appended to the URL.

import Sitemap from "/snippets/javascript-integrations/examples/document_loaders/sitemap.mdx";

<Sitemap />

Or, if you want to only load the sitemap and not the contents of each page from the sitemap, you can use the `parseSitemap` method:

import ParseSitemap from "/snippets/javascript-integrations/examples/document_loaders/parse_sitemap.mdx";

<ParseSitemap />
